﻿using System.Linq;
using Company.Merchandising.BusinessLayer.DataEntities;

namespace Company.Merchandising.DataAccessLayer.DataAccessCommon
{
	public class DACRole : DACBase
	{
		public DACRole(MerchModelEntities modelEntities) : base(modelEntities) { }

		public IQueryable<Role> GetRolesByName(string roleName)
		{
			return from role in _modelEntities.Role where role.Name == roleName select role;
		}

		public Role GetRoleById(int roleId)
		{
			return (from role in _modelEntities.Role where role.Id == roleId select role).FirstOrDefault();
		}
	}
}
